﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ColdSun.BankManagements
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            pnlMain.Controls.Clear();
            //CtrlInsurance control = new CtrlInsurance();
            CtrlInsuranceForBranchByMonth control = new CtrlInsuranceForBranchByMonth();
            pnlMain.Controls.Add(control);
        }

        private void mnuStatementCredit_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlStatementCredit))
            {
                this.pnlMain.Controls.Clear();
                CtrlStatementCredit control = new CtrlStatementCredit();
                this.pnlMain.Controls.Add(control);
            }
        }

        private void mnuServiceDeskUser_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlServiceDeskUser))
            {
                this.pnlMain.Controls.Clear();
                CtrlServiceDeskUser control = new CtrlServiceDeskUser();
                this.pnlMain.Controls.Add(control);
            }
        }

        private void mnuUpdateAddress_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlUpdateAddress))
            {
                this.pnlMain.Controls.Clear();
                CtrlUpdateAddress control = new CtrlUpdateAddress();
                this.pnlMain.Controls.Add(control);
            }
        }

        private void mnuAbout_Click(object sender, EventArgs e)
        {
            FrmAbout frmAbout = new FrmAbout();
            frmAbout.ShowDialog();
        }

        private void mnuInsuranceForBranchByMonth_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlInsuranceForBranchByMonth))
            {
                this.pnlMain.Controls.Clear();
                CtrlInsuranceForBranchByMonth control = new CtrlInsuranceForBranchByMonth();
                this.pnlMain.Controls.Add(control);
            }
        }

        private void mnuInsuranceForBranchByWeek_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlInsurance))
            {
                this.pnlMain.Controls.Clear();
                CtrlInsurance control = new CtrlInsurance();
                this.pnlMain.Controls.Add(control);
            }
        }

        private void bKCPForBranchByMonthToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.pnlMain.Controls.Count > 0 && !(this.pnlMain.Controls[0] is CtrlInsuranceForBKCPByMonth))
            {
                this.pnlMain.Controls.Clear();
                CtrlInsuranceForBKCPByMonth control = new CtrlInsuranceForBKCPByMonth();
                this.pnlMain.Controls.Add(control);
            }
        }

        
    }
}
